package GUILayer;

import GUILayer.testSale; // to test sale
import ModelLayer.Item;
import ControlLayer.*;

import java.awt.EventQueue;

import javax.net.ssl.SSLEngineResult.Status;
import javax.swing.JFrame;
import javax.swing.JPanel;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.FlowLayout;

import javax.swing.border.BevelBorder;
import javax.swing.UIManager;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import javax.swing.JToolBar;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JMenu;
import javax.swing.event.MenuKeyListener;
import javax.swing.event.MenuKeyEvent;
import javax.swing.border.TitledBorder;
import javax.swing.JTabbedPane;

import java.awt.SystemColor;
import java.awt.Color;

import javax.swing.JLayeredPane;
import javax.swing.JDesktopPane;
import javax.swing.JButton;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

import javax.swing.JTextField;
import javax.swing.JTable;
import javax.swing.border.MatteBorder;
import javax.swing.ListSelectionModel;
import javax.swing.border.LineBorder;

import java.awt.Font;
import java.util.ArrayList;

import javax.swing.JSeparator;
import javax.swing.border.SoftBevelBorder;
import javax.swing.JRadioButton;
import javax.swing.JScrollBar;
import javax.swing.JComboBox;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.JTextArea;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JEditorPane;
import javax.swing.ButtonGroup;


public class MainWindow {

	private JFrame frmVestbjergByggecenterAs;
	private JTextField saleFindCustomerText;
	private JTable table;
	private JTable saleAddCustomerTable;
	private JTextField saleFindItemText;
	private JTable saleAddItemTable;
	private JTextField saleAddItemAmountText;
	private JTextField personNameText;
	private JTextField personIDText;
	private JTextField personAdresseText;
	private JTextField personEmailText;
	private JTextField personPhoneText;
	private JTextField personCustomerDiscountText;
	private JTextField personCVR;
	private JTable table_1;
	private JTable table_2;
	private JTextField personSearchText;
	private JTextField textField_8;
	private JTextField textField_9;
	private JTextField textField_10;
	private JTextField textField_11;
	private JTable salesFinishSalesList;
	private final ButtonGroup buttonGroup = new ButtonGroup();
	private JRadioButton personEmployeeRadioButton;
	
	// ControlLayer
	private PersonCtr personCtr;
	private SaleCtr saleCtr;
	private StorageCtr storageCtr;
	private JTable itemTableItemList;
	
	private ArrayList<Item> items;
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					MainWindow window = new MainWindow();
					window.frmVestbjergByggecenterAs.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public MainWindow() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frmVestbjergByggecenterAs = new JFrame();
		frmVestbjergByggecenterAs.setTitle("Vestbjerg Byggecenter A/S");
		frmVestbjergByggecenterAs.setAlwaysOnTop(true);
		frmVestbjergByggecenterAs.setResizable(false);
		frmVestbjergByggecenterAs.setBounds(100, 100, 800, 600);
		frmVestbjergByggecenterAs.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frmVestbjergByggecenterAs.getContentPane().setLayout(new BorderLayout(0, 0));
		
		JPanel statusBar = new JPanel();
		statusBar.setBorder(new LineBorder(new Color(0, 0, 0)));
		FlowLayout fl_statusBar = (FlowLayout) statusBar.getLayout();
		fl_statusBar.setAlignment(FlowLayout.LEFT);
		fl_statusBar.setAlignOnBaseline(true);
		frmVestbjergByggecenterAs.getContentPane().add(statusBar, BorderLayout.SOUTH);
		
		final JLabel staturBarText = new JLabel(" ");
		statusBar.add(staturBarText);
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		tabbedPane.setToolTipText("");
		tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
		tabbedPane.setForeground(Color.BLACK);
		frmVestbjergByggecenterAs.getContentPane().add(tabbedPane, BorderLayout.CENTER);
		
		JLayeredPane layeredPane = new JLayeredPane();
		layeredPane.setForeground(Color.LIGHT_GRAY);
		tabbedPane.addTab("Nyt Salg", null, layeredPane, null);
		layeredPane.setLayout(new BorderLayout(0, 0));
		
		JPanel newSalePanel = new JPanel();
		newSalePanel.setToolTipText("");
		layeredPane.add(newSalePanel, BorderLayout.CENTER);
		newSalePanel.setLayout(null);
		
		JPanel saleAddCustomerPanel = new JPanel();
		saleAddCustomerPanel.setLayout(null);
		saleAddCustomerPanel.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
		saleAddCustomerPanel.setBounds(10, 11, 356, 221);
		newSalePanel.add(saleAddCustomerPanel);
		
		JButton saleAddCustomerButton = new JButton("Tilf\u00F8j Kunde");
		saleAddCustomerButton.setBounds(232, 191, 111, 23);
		saleAddCustomerPanel.add(saleAddCustomerButton);
		
		JButton SaleFindCustomerButton = new JButton("Find Kunde");
		SaleFindCustomerButton.setBounds(140, 48, 105, 23);
		saleAddCustomerPanel.add(SaleFindCustomerButton);
		
		JLabel saleFindCustomerLabel = new JLabel("Find kunde via ID");
		saleFindCustomerLabel.setBounds(10, 35, 126, 14);
		saleAddCustomerPanel.add(saleFindCustomerLabel);
		
		saleFindCustomerText = new JTextField();
		saleFindCustomerText.setColumns(10);
		saleFindCustomerText.setBounds(10, 49, 120, 20);
		saleAddCustomerPanel.add(saleFindCustomerText);
		
		JButton saleClearCustomerSearchButton = new JButton("Nulstil ");
		saleClearCustomerSearchButton.setBounds(255, 48, 88, 23);
		saleAddCustomerPanel.add(saleClearCustomerSearchButton);
		
		table = new JTable();
		table.setBorder(new LineBorder(new Color(0, 0, 0)));
		table.setBounds(10, 80, 330, 100);
		
		saleAddCustomerPanel.add(table);
		
		JPanel saleActualSalePanel = new JPanel();
		saleActualSalePanel.setLayout(null);
		saleActualSalePanel.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
		saleActualSalePanel.setBounds(375, 11, 404, 481);
		newSalePanel.add(saleActualSalePanel);
		
		JLabel label_1 = new JLabel("Kunde");
		label_1.setFont(new Font("Tahoma", Font.PLAIN, 18));
		label_1.setBounds(10, 50, 119, 31);
		saleActualSalePanel.add(label_1);
		
		JLabel label_2 = new JLabel("Medarbejder");
		label_2.setFont(new Font("Tahoma", Font.PLAIN, 18));
		label_2.setBounds(10, 21, 119, 31);
		saleActualSalePanel.add(label_2);
		
		JLabel label_3 = new JLabel("Tilf\u00F8jede Varer i Salget");
		label_3.setFont(new Font("Tahoma", Font.PLAIN, 18));
		label_3.setBounds(10, 81, 384, 22);
		saleActualSalePanel.add(label_3);
		
		JLabel label_4 = new JLabel("Samlet Pris");
		label_4.setFont(new Font("Tahoma", Font.PLAIN, 18));
		label_4.setBounds(10, 357, 128, 22);
		saleActualSalePanel.add(label_4);
		
		JLabel label_5 = new JLabel("Kundens Rabat");
		label_5.setFont(new Font("Tahoma", Font.PLAIN, 18));
		label_5.setBounds(10, 381, 128, 22);
		saleActualSalePanel.add(label_5);
		
		JLabel lblTotalPris = new JLabel("Total pris");
		lblTotalPris.setFont(new Font("Tahoma", Font.PLAIN, 18));
		lblTotalPris.setBounds(10, 404, 128, 22);
		saleActualSalePanel.add(lblTotalPris);
		
		JButton salePaymentButton = new JButton("Betaling");
		salePaymentButton.setBounds(283, 437, 111, 23);
		saleActualSalePanel.add(salePaymentButton);
		
		JButton saleCancelSaleButton = new JButton("Annulere Salget");
		saleCancelSaleButton.setBounds(116, 437, 157, 23);
		saleActualSalePanel.add(saleCancelSaleButton);
		
		JLabel label_7 = new JLabel("0DKR");
		label_7.setFont(new Font("Tahoma", Font.PLAIN, 18));
		label_7.setBounds(148, 404, 246, 22);
		saleActualSalePanel.add(label_7);
		
		JLabel label_8 = new JLabel("0%");
		label_8.setFont(new Font("Tahoma", Font.PLAIN, 18));
		label_8.setBounds(148, 381, 246, 22);
		saleActualSalePanel.add(label_8);
		
		JLabel label_9 = new JLabel("0DKR");
		label_9.setFont(new Font("Tahoma", Font.PLAIN, 18));
		label_9.setBounds(148, 357, 246, 22);
		saleActualSalePanel.add(label_9);
		
		JLabel label_10 = new JLabel("PERSON");
		label_10.setFont(new Font("Tahoma", Font.PLAIN, 18));
		label_10.setBounds(139, 50, 119, 31);
		saleActualSalePanel.add(label_10);
		
		JLabel label_11 = new JLabel("ANSAT");
		label_11.setFont(new Font("Tahoma", Font.PLAIN, 18));
		label_11.setBounds(139, 21, 119, 31);
		saleActualSalePanel.add(label_11);
		
		saleAddCustomerTable = new JTable();
		saleAddCustomerTable.setBorder(new LineBorder(new Color(0, 0, 0)));
		saleAddCustomerTable.setBounds(10, 114, 384, 201);
		saleActualSalePanel.add(saleAddCustomerTable);
		
		JButton btnFjernVare = new JButton("Fjern Vare");
		btnFjernVare.setBounds(237, 326, 157, 23);
		saleActualSalePanel.add(btnFjernVare);
		
		JPanel saleAddItemPanel = new JPanel();
		saleAddItemPanel.setLayout(null);
		saleAddItemPanel.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
		saleAddItemPanel.setBounds(10, 243, 356, 243);
		newSalePanel.add(saleAddItemPanel);
		
		JButton saleAddItemButton = new JButton("Tilf\u00F8j Vare");
		saleAddItemButton.setBounds(229, 209, 111, 23);
		saleAddItemPanel.add(saleAddItemButton);
		
		JLabel saleFindItemLabel = new JLabel("Find Vare via ID");
		saleFindItemLabel.setBounds(10, 29, 124, 14);
		saleAddItemPanel.add(saleFindItemLabel);
		
		saleFindItemText = new JTextField();
		saleFindItemText.setColumns(10);
		saleFindItemText.setBounds(10, 43, 124, 20);
		saleAddItemPanel.add(saleFindItemText);
		
		JButton saleFindItemButton = new JButton("Find Vare");
		saleFindItemButton.setBounds(144, 42, 98, 23);
		saleAddItemPanel.add(saleFindItemButton);
		
		JButton saleClearItemSearchButton = new JButton("Nulstil ");
		saleClearItemSearchButton.setBounds(252, 42, 88, 23);
		saleAddItemPanel.add(saleClearItemSearchButton);
		
		saleAddItemTable = new JTable();
		saleAddItemTable.setBorder(new LineBorder(new Color(0, 0, 0)));
		saleAddItemTable.setBounds(10, 74, 330, 112);
		saleAddItemPanel.add(saleAddItemTable);
		
		saleAddItemAmountText = new JTextField();
		saleAddItemAmountText.setColumns(10);
		saleAddItemAmountText.setBounds(10, 212, 124, 20);
		saleAddItemPanel.add(saleAddItemAmountText);
		
		JLabel saleItemAmountLabel = new JLabel("Antal");
		saleItemAmountLabel.setBounds(10, 198, 124, 14);
		saleAddItemPanel.add(saleItemAmountLabel);
		
		JLayeredPane layeredPane_1 = new JLayeredPane();
		tabbedPane.addTab("Salgshistorik", null, layeredPane_1, null);
		layeredPane_1.setLayout(new BorderLayout(0, 0));
		
		JPanel panel_3 = new JPanel();
		layeredPane_1.add(panel_3, BorderLayout.CENTER);
		panel_3.setLayout(null);
		
		JPanel panel_18 = new JPanel();
		panel_18.setBorder(new TitledBorder(null, "Salgshistorik", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel_18.setBounds(10, 11, 769, 475);
		panel_3.add(panel_18);
		panel_18.setLayout(null);
		
		JPanel panel_19 = new JPanel();
		panel_19.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
		panel_19.setBounds(10, 22, 737, 379);
		panel_18.add(panel_19);
		panel_19.setLayout(null);
		
		salesFinishSalesList = new JTable();
		salesFinishSalesList.setBounds(25, 23, 168, 333);
		panel_19.add(salesFinishSalesList);
		salesFinishSalesList.setBorder(new LineBorder(new Color(0, 0, 0)));
		
		JTextArea salesSaleInformation = new JTextArea();
		salesSaleInformation.setBorder(new LineBorder(new Color(0, 0, 0)));
		salesSaleInformation.setBounds(210, 23, 501, 333);
		panel_19.add(salesSaleInformation);
		salesSaleInformation.setEditable(false);
		
		JPanel panel_20 = new JPanel();
		panel_20.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
		panel_20.setBounds(10, 412, 737, 46);
		panel_18.add(panel_20);
		panel_20.setLayout(null);
		
		JButton salesDeleteFinishedSaleButton = new JButton("Slet Gemt Salg");
		salesDeleteFinishedSaleButton.setBounds(51, 11, 140, 23);
		panel_20.add(salesDeleteFinishedSaleButton);
		
		JLayeredPane layeredPane_2 = new JLayeredPane();
		tabbedPane.addTab("Varer", null, layeredPane_2, null);
		layeredPane_2.setLayout(new BorderLayout(0, 0));
		
		JPanel panel_2 = new JPanel();
		layeredPane_2.add(panel_2, BorderLayout.CENTER);
		panel_2.setLayout(null);
		
		JPanel panel_12 = new JPanel();
		panel_12.setLayout(null);
		panel_12.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Oprettelse/opdatering af varer", TitledBorder.LEFT, TitledBorder.TOP, null, null));
		panel_12.setBounds(10, 11, 281, 475);
		panel_2.add(panel_12);
		
		JPanel panel_13 = new JPanel();
		panel_13.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
		panel_13.setBounds(10, 425, 261, 39);
		panel_12.add(panel_13);
		panel_13.setLayout(null);
		
		JButton button_4 = new JButton("Tilf\u00F8j vare");
		
		button_4.setBounds(10, 8, 110, 23);
		panel_13.add(button_4);
		
		JButton button_5 = new JButton("Opdater vare");
		button_5.setBounds(130, 8, 121, 23);
		panel_13.add(button_5);
		
		JPanel panel_14 = new JPanel();
		panel_14.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
		panel_14.setBounds(10, 22, 261, 392);
		panel_12.add(panel_14);
		panel_14.setLayout(null);
		
		JLabel label_21 = new JLabel("Pris");
		label_21.setBounds(10, 147, 181, 14);
		panel_14.add(label_21);
		
		textField_10 = new JTextField();
		textField_10.setBounds(10, 165, 165, 20);
		panel_14.add(textField_10);
		textField_10.setToolTipText("Indtast varens pris");
		textField_10.setColumns(10);
		
		JLabel label_22 = new JLabel("DKK");
		label_22.setBounds(185, 168, 66, 14);
		panel_14.add(label_22);
		
		textField_9 = new JTextField();
		textField_9.setBounds(10, 104, 181, 22);
		panel_14.add(textField_9);
		textField_9.setToolTipText("Indtast varens type");
		textField_9.setColumns(10);
		
		JLabel label_20 = new JLabel("Type");
		label_20.setBounds(10, 77, 175, 16);
		panel_14.add(label_20);
		
		textField_8 = new JTextField();
		textField_8.setBounds(10, 44, 181, 22);
		panel_14.add(textField_8);
		textField_8.setToolTipText("Indtast varens navn");
		textField_8.setColumns(10);
		
		JLabel label_19 = new JLabel("Navn");
		label_19.setBounds(10, 17, 181, 16);
		panel_14.add(label_19);
		
		JPanel panel_15 = new JPanel();
		panel_15.setLayout(null);
		panel_15.setBorder(new TitledBorder(UIManager.getBorder("TitledBorder.border"), "Registrerede varer ", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel_15.setBounds(294, 11, 463, 475);
		panel_2.add(panel_15);
		
		JPanel panel_16 = new JPanel();
		panel_16.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
		panel_16.setBounds(12, 423, 439, 41);
		panel_15.add(panel_16);
		panel_16.setLayout(null);
		
		JButton button_7 = new JButton("Slet vare");
		button_7.setBounds(354, 11, 75, 23);
		button_7.setHorizontalAlignment(SwingConstants.RIGHT);
		panel_16.add(button_7);
		
		JPanel panel_17 = new JPanel();
		panel_17.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
		panel_17.setBounds(12, 23, 439, 389);
		panel_15.add(panel_17);
		panel_17.setLayout(null);
		
		JScrollBar scrollBar_1 = new JScrollBar();
		scrollBar_1.setBounds(408, 76, 21, 302);
		panel_17.add(scrollBar_1);
		
		textField_11 = new JTextField();
		textField_11.setBounds(10, 43, 305, 22);
		panel_17.add(textField_11);
		textField_11.setColumns(10);
		
		JLabel lblFindRegistreredeVarer = new JLabel("Find registrerede varer via id eller navn");
		lblFindRegistreredeVarer.setBounds(10, 16, 238, 16);
		panel_17.add(lblFindRegistreredeVarer);
		
		JButton button_6 = new JButton("Find vare");
		button_6.setBounds(325, 40, 97, 25);
		panel_17.add(button_6);
			
	
		JTable itemTableItemList = new JTable();
		itemTableItemList.setBorder(new LineBorder(new Color(0, 0, 0)));
		
		itemTableItemList.setBounds(10, 76, 388, 302);
		
		panel_17.add(itemTableItemList);
		
		JLayeredPane layeredPane_3 = new JLayeredPane();
		tabbedPane.addTab("Personer", null, layeredPane_3, null);
		layeredPane_3.setLayout(new BorderLayout(0, 0));
		
		JPanel panel_1 = new JPanel();
		layeredPane_3.add(panel_1, BorderLayout.CENTER);
		panel_1.setLayout(null);
		
		JPanel panel_4 = new JPanel();
		panel_4.setLayout(null);
		panel_4.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Oprettelse / opdatering af person", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel_4.setBounds(0, 0, 302, 497);
		panel_1.add(panel_4);
		
		JPanel panel_5 = new JPanel();
		panel_5.setLayout(null);
		panel_5.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
		panel_5.setBounds(10, 23, 282, 202);
		panel_4.add(panel_5);
		
		personNameText = new JTextField();
		personNameText.setColumns(10);
		personNameText.setBounds(10, 29, 141, 20);
		panel_5.add(personNameText);
		
		personIDText = new JTextField();
		personIDText.setColumns(10);
		personIDText.setBounds(179, 29, 94, 20);
		panel_5.add(personIDText);
		
		JLabel personNameLabel = new JLabel("Navn");
		personNameLabel.setFont(new Font("Tahoma", Font.PLAIN, 15));
		personNameLabel.setBounds(10, 11, 46, 14);
		panel_5.add(personNameLabel);
		
		JLabel personIDLabel = new JLabel("ID");
		personIDLabel.setFont(new Font("Tahoma", Font.PLAIN, 15));
		personIDLabel.setBounds(179, 11, 46, 14);
		panel_5.add(personIDLabel);
		
		JLabel personAddressLabel = new JLabel("Adresse");
		personAddressLabel.setFont(new Font("Tahoma", Font.PLAIN, 15));
		personAddressLabel.setBounds(10, 60, 81, 14);
		panel_5.add(personAddressLabel);
		
		personAdresseText = new JTextField();
		personAdresseText.setColumns(10);
		personAdresseText.setBounds(10, 75, 262, 20);
		panel_5.add(personAdresseText);
		
		JLabel personEmailLabel = new JLabel("E-mail adresse");
		personEmailLabel.setFont(new Font("Tahoma", Font.PLAIN, 15));
		personEmailLabel.setBounds(10, 106, 103, 14);
		panel_5.add(personEmailLabel);
		
		personEmailText = new JTextField();
		personEmailText.setColumns(10);
		personEmailText.setBounds(10, 123, 262, 20);
		panel_5.add(personEmailText);
		
		JLabel personPhoneLabel = new JLabel("Telefon");
		personPhoneLabel.setFont(new Font("Tahoma", Font.PLAIN, 15));
		personPhoneLabel.setBounds(10, 154, 59, 14);
		panel_5.add(personPhoneLabel);
		
		personPhoneText = new JTextField();
		personPhoneText.setColumns(10);
		personPhoneText.setBounds(10, 171, 262, 20);
		panel_5.add(personPhoneText);
		
		JPanel panel_6 = new JPanel();
		panel_6.setLayout(null);
		panel_6.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
		panel_6.setBounds(10, 236, 282, 42);
		panel_4.add(panel_6);
		
		final JRadioButton personCustomerRadioButton = new JRadioButton("Kunde");
		personCustomerRadioButton.setSelected(true);
		buttonGroup.add(personCustomerRadioButton);
		personCustomerRadioButton.setBounds(25, 7, 109, 23);
		panel_6.add(personCustomerRadioButton);
		
		personEmployeeRadioButton = new JRadioButton("Medarbejder");
		buttonGroup.add(personEmployeeRadioButton);
		personEmployeeRadioButton.setBounds(131, 7, 109, 23);
		panel_6.add(personEmployeeRadioButton);	
		
		
		
		JPanel panel_7 = new JPanel();
		panel_7.setLayout(null);
		panel_7.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
		panel_7.setBounds(10, 444, 282, 42);
		panel_4.add(panel_7);
		
		JButton button = new JButton("Tilf\u00F8j person");
		button.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				String newName = personNameText.getText();
				String newID = personIDText.getText();
				String newAddress = personAdresseText.getText();
				String newEmail = personEmailText.getText();
				String newPhone = personPhoneText.getText();
				double newDiscount = Double.parseDouble(personCustomerDiscountText.getText());
				String newCvr = personCVR.getText();
					
				
				if(personCustomerRadioButton.isSelected())
				{
					personCtr.addCustomer(newName, newAddress, newPhone, newEmail, newID, newDiscount, newCvr);
				}
				else
				{
					personCtr.addEmployee(newName, newAddress, newPhone, newEmail, newID);
				}
				
			}
		});
		button.setBounds(10, 11, 115, 23);
		panel_7.add(button);
		
		JButton button_1 = new JButton("Opdatere person");
		button_1.setEnabled(false);
		button_1.setBounds(157, 11, 115, 23);
		panel_7.add(button_1);
		
		JPanel personCustomerPanel = new JPanel();
		personCustomerPanel.setLayout(null);
		personCustomerPanel.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
		personCustomerPanel.setBounds(10, 289, 282, 146);
		panel_4.add(personCustomerPanel);
		
		JLabel personDiscountLabel = new JLabel("Kunde rabat");
		personDiscountLabel.setFont(new Font("Tahoma", Font.PLAIN, 15));
		personDiscountLabel.setBounds(10, 11, 91, 14);
		personCustomerPanel.add(personDiscountLabel);
		
		personCustomerDiscountText = new JTextField();
		personCustomerDiscountText.setColumns(10);
		personCustomerDiscountText.setBounds(15, 36, 86, 20);
		personCustomerPanel.add(personCustomerDiscountText);
		
		JLabel personProcentLabel = new JLabel("Procent");
		personProcentLabel.setBounds(106, 39, 46, 14);
		personCustomerPanel.add(personProcentLabel);
		
		JLabel personCvrLabel = new JLabel("CVR nummer");
		personCvrLabel.setFont(new Font("Tahoma", Font.PLAIN, 15));
		personCvrLabel.setBounds(10, 72, 91, 14);
		personCustomerPanel.add(personCvrLabel);
		
		personCVR = new JTextField();
		personCVR.setColumns(10);
		personCVR.setBounds(10, 97, 119, 20);
		personCustomerPanel.add(personCVR);
		
		JPanel panel_9 = new JPanel();
		panel_9.setLayout(null);
		panel_9.setBorder(new TitledBorder(new LineBorder(new Color(0, 0, 0)), "Registered personer", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel_9.setBounds(312, 0, 467, 486);
		panel_1.add(panel_9);
		
		JPanel panel_10 = new JPanel();
		panel_10.setLayout(null);
		panel_10.setBorder(null);
		panel_10.setBounds(10, 112, 432, 329);
		panel_9.add(panel_10);
		
		JScrollBar scrollBar = new JScrollBar();
		scrollBar.setBackground(Color.LIGHT_GRAY);
		scrollBar.setBounds(415, 0, 17, 310);
		panel_10.add(scrollBar);
		
		table_1 = new JTable();
		table_1.setBounds(10, 0, 1, 1);
		panel_10.add(table_1);
		
		table_2 = new JTable();
		table_2.setBorder(new LineBorder(new Color(0, 0, 0)));
		table_2.setBounds(0, 0, 409, 329);
		panel_10.add(table_2);
		
		JPanel panel_11 = new JPanel();
		panel_11.setLayout(null);
		panel_11.setBorder(new SoftBevelBorder(BevelBorder.RAISED, null, null, null, null));
		panel_11.setBounds(10, 24, 435, 77);
		panel_9.add(panel_11);
		
		personSearchText = new JTextField();
		personSearchText.setColumns(10);
		personSearchText.setBounds(10, 40, 316, 20);
		panel_11.add(personSearchText);
		
		JButton personSearchButton = new JButton("S\u00F8g");
		personSearchButton.setBounds(336, 39, 89, 23);
		panel_11.add(personSearchButton);
		
		JLabel personSearchLabel = new JLabel("S\u00F8g efter ID");
		personSearchLabel.setFont(new Font("Tahoma", Font.PLAIN, 15));
		personSearchLabel.setBounds(10, 11, 251, 25);
		panel_11.add(personSearchLabel);
		
		JComboBox personComboBox = new JComboBox();
		personComboBox.setModel(new DefaultComboBoxModel(new String[] {"Kunde\t", "Medarbejder"}));
		personComboBox.setFont(new Font("Tahoma", Font.PLAIN, 15));
		personComboBox.setBounds(313, 11, 112, 20);
		panel_11.add(personComboBox);
		
		JButton personRemoveButton = new JButton("Fjern person");
		personRemoveButton.setBounds(342, 452, 115, 23);
		panel_9.add(personRemoveButton);
		
		JMenuBar menuBar = new JMenuBar();
		frmVestbjergByggecenterAs.setJMenuBar(menuBar);
		
		JMenu mnMenu = new JMenu("Menu");
		menuBar.add(mnMenu);
		
		JMenuItem mntmStatistik = new JMenuItem("Statistik");
		mntmStatistik.setEnabled(false);
		mnMenu.add(mntmStatistik);
		
		JSeparator separator = new JSeparator();
		mnMenu.add(separator);
		
		JMenuItem mntmNewMenuItem = new JMenuItem("Afslut Programmet");
		mntmNewMenuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				System.exit(0); // exit the program
			}
		});
		mnMenu.add(mntmNewMenuItem);
	}
	
	// own methods
	
	
	
	
}
